package com.isoft.dailymanprovidor.controller;

import com.isoft.dailymanprovidor.bean.ResponseData;
import com.isoft.dailymanprovidor.entity.MeetingSign;
import com.isoft.dailymanprovidor.service.MeetingSignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@Slf4j
@RequestMapping("/systemdailyman/meetingsign")
public class MeetingSignController extends BaseController {
    @Autowired
    MeetingSignService meetingSignService;
    //分页获取会议招待信息
    @GetMapping("/getallmeetingsign")
    public ResponseData getallmeetingsign(Integer currentPage, Integer size, String date,String leader,String department){
        return meetingSignService.getallPage(currentPage, size, date, leader, department);
    }
    //新增会议招待
    @PutMapping("/addmeetingsign")
    public ResponseData<Boolean> addmeetingsign(@RequestBody MeetingSign meetingSign){
        return returnBoolean(meetingSignService.addmeetingsign(meetingSign));
    }
    //修改会议招待信息
    @PutMapping("/updatemeetingsign")
    public ResponseData<Boolean> updatemeetingsign(@RequestBody MeetingSign meetingSign){
        return  returnBoolean(meetingSignService.updatemeetingsign(meetingSign));
    }
    //删除会议招待信息
    @DeleteMapping("/deletemeetingsign/{id}")
    public ResponseData<Boolean> deletemeetingsign(@PathVariable("id") Integer id){
        return returnBoolean(meetingSignService.deletemeetingsign(id));
    }
    //会议招待审核
    @PutMapping("/manstatus")
    public ResponseData<Boolean> manupdatestatus(@RequestBody MeetingSign meetingSign){
        return returnBoolean(meetingSignService.manupdatestatus(meetingSign));
    }
}
